
package cn.edu.scau.cmi.hombio.web.rest;

import org.junit.Test;

import org.junit.runner.RunWith;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;

import org.springframework.context.ApplicationContext;

import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;

import org.springframework.test.context.ContextConfiguration;

import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.RequestScope;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.context.request.SessionScope;

/**
 * Unit test for the <code>PreventionTypeRestController</code> controller.
 *
 * @see cn.edu.scau.cmi.hombio.web.rest.PreventionTypeRestController
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
		"file:./resources/pigRs-security-context.xml",
		"file:./resources/pigRs-service-context.xml",
		"file:./resources/pigRs-dao-context.xml",
		"file:./resources/pigRs-web-context.xml" })
public class PreventionTypeRestControllerTest {
	/**
	 * The Spring application context.
	 *
	 */
	private ApplicationContext context;

	/**
	 * Test <code>PreventionTypepreventiontype_idmedicineByReportMedicineId()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPreventionTypepreventiontype_idmedicineByReportMedicineId() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/medicineByReportMedicineId");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idmedicineByReportMedicineId()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostPreventionTypepreventiontype_idmedicineByReportMedicineId() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/medicineByReportMedicineId");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idmedicineByReportMedicineId()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutPreventionTypepreventiontype_idmedicineByReportMedicineId() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/medicineByReportMedicineId");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idmedicineByReportMedicineIdmedicine_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeletePreventionTypepreventiontype_idmedicineByReportMedicineIdmedicine_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/medicineByReportMedicineId/{medicine_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idmedicineByReportMedicineIdmedicine_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPreventionTypepreventiontype_idmedicineByReportMedicineIdmedicine_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/medicineByReportMedicineId/{medicine_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idmedicineByMedicineId()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPreventionTypepreventiontype_idmedicineByMedicineId() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/medicineByMedicineId");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idmedicineByMedicineId()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostPreventionTypepreventiontype_idmedicineByMedicineId() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/medicineByMedicineId");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idmedicineByMedicineId()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutPreventionTypepreventiontype_idmedicineByMedicineId() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/medicineByMedicineId");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idmedicineByMedicineIdmedicine_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeletePreventionTypepreventiontype_idmedicineByMedicineIdmedicine_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/medicineByMedicineId/{medicine_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idmedicineByMedicineIdmedicine_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPreventionTypepreventiontype_idmedicineByMedicineIdmedicine_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/medicineByMedicineId/{medicine_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idunitByUnitId()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPreventionTypepreventiontype_idunitByUnitId() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/unitByUnitId");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idunitByUnitId()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostPreventionTypepreventiontype_idunitByUnitId() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/unitByUnitId");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idunitByUnitId()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutPreventionTypepreventiontype_idunitByUnitId() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/unitByUnitId");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idunitByUnitIdunit_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeletePreventionTypepreventiontype_idunitByUnitIdunit_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/unitByUnitId/{unit_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idunitByUnitIdunit_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPreventionTypepreventiontype_idunitByUnitIdunit_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/unitByUnitId/{unit_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idunitByReportUnitId()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPreventionTypepreventiontype_idunitByReportUnitId() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/unitByReportUnitId");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idunitByReportUnitId()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostPreventionTypepreventiontype_idunitByReportUnitId() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/unitByReportUnitId");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idunitByReportUnitId()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutPreventionTypepreventiontype_idunitByReportUnitId() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/unitByReportUnitId");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idunitByReportUnitIdunit_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeletePreventionTypepreventiontype_idunitByReportUnitIdunit_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/unitByReportUnitId/{unit_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idunitByReportUnitIdunit_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPreventionTypepreventiontype_idunitByReportUnitIdunit_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/unitByReportUnitId/{unit_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idtaskPreventions()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPreventionTypepreventiontype_idtaskPreventions() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/taskPreventions");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idtaskPreventions()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostPreventionTypepreventiontype_idtaskPreventions() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/taskPreventions");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idtaskPreventions()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutPreventionTypepreventiontype_idtaskPreventions() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/taskPreventions");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idtaskPreventionstaskprevention_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeletePreventionTypepreventiontype_idtaskPreventionstaskprevention_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/taskPreventions/{taskprevention_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_idtaskPreventionstaskprevention_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPreventionTypepreventiontype_idtaskPreventionstaskprevention_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}/taskPreventions/{taskprevention_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionType()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPreventionType() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPreventionTypepreventiontype_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionType()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutPreventionType() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionType()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostPreventionType() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>PreventionTypepreventiontype_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeletePreventionTypepreventiontype_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/PreventionType/{preventiontype_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PreventionTypeRestController controller = (PreventionTypeRestController) context.getBean("PreventionTypeRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Autowired to set the Spring application context.
	 *
	 */
	@Autowired
	public void setContext(ApplicationContext context) {
		this.context = context;
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("session", new SessionScope());
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("request", new RequestScope());
	}

	/**
	 * Returns a mock HttpServletRequest object.
	 *
	 */
	private MockHttpServletRequest getMockHttpServletRequest() {
		MockHttpServletRequest request = new MockHttpServletRequest();
		ServletRequestAttributes attributes = new ServletRequestAttributes(request);
		RequestContextHolder.setRequestAttributes(attributes);
		return request;
	}

	/**
	 * Returns a mock HttpServletResponse object.
	 *
	 */
	private MockHttpServletResponse getMockHttpServletResponse() {
		return new MockHttpServletResponse();
	}
}